import Vue from "vue";
import VueRouter from "vue-router";
const Main = () => import("../views/Main");
const Index = () => import("../views/index");
const Integral = () => import("../views/integral");
const Mine = () => import("../views/mine");
const Cart = () => import("../views/cart");
const Store = () => import("../views/store");
const VideoCategory = () => import("../views/index/video/category");
const VideoDetails = () => import("../views/index/video/details");
const Activity = () => import("../views/index/activity");
const ActivityDetails = () => import("../views/index/activity/details");
const Doctors = () => import("../views/index/doctors"); //线下活动
const Course = () => import("../views/index/course"); //课程报名
const Vip = () => import("../views/index/vip"); //会员通道
const is_404 = () => import("../views/404");
Vue.use(VueRouter);
const routes = [
  {
    path: "/",
    name: "Main",
    component: Main,
    redirect: "/index",
    children: [
      {
        path: "/index",
        name: "index",
        component: Index
      },
      {
        path: "/integral",
        name: "integral",
        component: Integral
      },
      {
        path: "/cart",
        name: "cart",
        component: Cart
      },
      {
        path: "/mine",
        name: "mine",
        component: Mine
      },
      {
        path: "/store",
        name: "store",
        component: Store
      }
    ]
  },
  {
    path: "/video/category",
    name: "videocategory",
    component: VideoCategory
  },
  {
    path: "/video/details",
    name: "videodetails",
    component: VideoDetails
  },
  {
    path: "/activity",
    name: "activity",
    component: Activity
  },
  {
    path: "/activity/details/:id",
    name: "activitydetails",
    component: ActivityDetails
  },
  {
    path: "/doctors",
    name: "doctors",
    component: Doctors
  },
  {
    path: "/course",
    name: "course",
    component: Course
  },
  {
    path: "/vip",
    name: "vip",
    component: Vip
  },
  {
    path: "/product/:store_id/:id",
    props: true,
    name: "product",
    component: () => import("../views/product")
  },
  {
    path: "*",
    component: is_404
  }
];

const router = new VueRouter({
  routes
});

export default router;
